package morerecursion;

public class Iterative {

	public static int add(int[] a){
		int result=0;
		int n = a.length;
		for (int i=0; i<n; i++)
			result = result + a[i];
		return result;
	}
	public static void main( String[] a ){
		final int[] array = {10, 3, -1, 72};
		int result = add( array );
		System.out.println( "Sum of all the elements of the array is " + result);
	}
}
